<style>
    /*获得奇偶数的子元素*/
    tr:nth-child(odd) {
        background-color: #fff;
    }
    tr:nth-child(even) {
        background-color: #FAFAFA;
    }
    /*同上一样的作用*/
    tr:nth-child(2n) {
        background-color: #fff;
    }
    tr:nth-child(2n+1) {
        background-color: #FAFAFA;
    }
</style>
<div class="modal" ng-controller="FlowableUserPopupCtrl">
    <div class="modal-dialog" style="width:900px">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="close()">&times;
                </button>
                <h2 translate>设置用户信息</h2>
            </div>
            <div class="modal-body" style="padding: 20px 20px 0 20px">
                <div class="detail-group clearfix">

                    <div class="form-group clearfix">
                        <div class="col-xs-12">

                            <!--  类型选择 -->
                            <div class="form-group clearfix">
                                <div class="col-xs-12">
                                    <div class="col-xs-4">
                                        <label>选择类型</label>
                                    </div>
                                    <div class="col-xs-8">
                                        <div class="btn-group span">
                                            <select ng-model="allocationSelect"
                                                    ng-options="x.title for x in allocationOperations"
                                                    ng-change="allocationChange()">
                                                <option value="">-- 请选择 --</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <!--  用户信息 -->
                            <div class="form-group clearfix" ng-if="allocation === 'user'">
                                <div class="col-xs-12" style="max-height:400px;overflow:auto;">
                                    <table class="table table-hover">
                                        <thead>
                                        <tr>
                                            <th>NO.</th>
                                            <th>用户编号</th>
                                            <th>用户名称</th>
                                            <th>状态</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-if="tableLoading" ng-repeat="x in userTableData">
                                            <th>
                                                <input type="checkbox" ng-model="x.isChecked" ng-click="userClick(x)"/>
                                            </th>
                                            <th>{{x.user_code}}</th>
                                            <th>{{x.real_name}}</th>
                                            <th>
                                                <span class="label label-danger" ng-if="x.status===1"
                                                      style="font-size: 12px">禁用</span>
                                                <span class="label label-info" ng-if="x.status===0"
                                                      style="font-size: 12px">正常</span>
                                            </th>
                                        </tr>
                                        <tr ng-if="!tableLoading">
                                            <th colspan="4" style="text-align: center">数据加载中......</th>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <!--  部门信息 -->
                            <div class="form-group clearfix" ng-if="allocation === 'dept'">
                                <div class="col-xs-12" style="max-height:400px;overflow:auto;">
                                    <table class="table table-hover">
                                        <thead>
                                        <tr>
                                            <th>NO.</th>
                                            <th>部门编号</th>
                                            <th>部门名称</th>
                                            <th>状态</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-if="tableLoading" ng-repeat="x in deptTableData">
                                            <th>
                                                <input type="checkbox" ng-model="x.isChecked" ng-click="deptClick(x)"/>
                                            </th>
                                            <th>{{x.code}}</th>
                                            <th>{{x.name}}</th>
                                            <th>
                                                <span class="label label-info" ng-if="x.status==='1'"
                                                      style="font-size: 12px">启用</span>
                                                <span class="label label-danger" ng-if="x.status==='0'"
                                                      style="font-size: 12px">禁用</span>
                                            </th>
                                        </tr>
                                        <tr ng-if="!tableLoading">
                                            <th colspan="4" style="text-align: center">数据加载中......</th>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <!--  岗位信息 -->
                            <div class="form-group clearfix" ng-if="allocation === 'post'">
                                <div class="col-xs-12" style="max-height:400px;overflow:auto;">
                                    <table class="table table-hover">
                                        <thead>
                                        <tr>
                                            <th>NO.</th>
                                            <th>岗位编号</th>
                                            <th>岗位名称</th>
                                            <th>状态</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-if="tableLoading" ng-repeat="x in postTableData">
                                            <th>
                                                <input type="checkbox" ng-model="x.isChecked" ng-click="postClick(x)"/>
                                            </th>
                                            <th>{{x.code}}</th>
                                            <th>{{x.name}}</th>
                                            <th>
                                                <span class="label label-info" ng-if="x.status==='1'"
                                                      style="font-size: 12px">启用</span>
                                                <span class="label label-danger" ng-if="x.status==='0'"
                                                      style="font-size: 12px">禁用</span>
                                            </th>
                                        </tr>
                                        <tr ng-if="!tableLoading">
                                            <th colspan="4" style="text-align: center">数据加载中......</th>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <!--  岗位组信息 -->
                            <div class="form-group clearfix" ng-if="allocation === 'group'">
                                <div class="col-xs-12" style="max-height:400px;overflow:auto;">
                                    <table class="table table-hover">
                                        <thead>
                                        <tr>
                                            <th>NO.</th>
                                            <th>组编号</th>
                                            <th>组名称</th>
                                            <th>状态</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-if="tableLoading" ng-repeat="x in groupTableData">
                                            <th>
                                                <input type="checkbox" ng-model="x.isChecked" ng-click="groupClick(x)"/>
                                            </th>
                                            <th>{{x.code}}</th>
                                            <th>{{x.name}}</th>
                                            <th>
                                                <span class="label label-info" ng-if="x.status==='1'"
                                                      style="font-size: 12px">启用</span>
                                                <span class="label label-danger" ng-if="x.status==='0'"
                                                      style="font-size: 12px">禁用</span>
                                            </th>
                                        </tr>
                                        <tr ng-if="!tableLoading">
                                            <th colspan="4" style="text-align: center">数据加载中......</th>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <!--  岗位等级信息 -->
                            <div class="form-group clearfix" ng-if="allocation === 'level'">
                                <div class="col-xs-12" style="max-height:400px;overflow:auto;">
                                    <table class="table table-hover">
                                        <thead>
                                        <tr>
                                            <th>NO.</th>
                                            <th>等级编号</th>
                                            <th>等级名称</th>
                                            <th>级别</th>
                                            <th>状态</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-if="tableLoading" ng-repeat="x in levelTableData">
                                            <th>
                                                <input type="checkbox" ng-model="x.isChecked" ng-click="levelClick(x)"/>
                                            </th>
                                            <th>{{x.code}}</th>
                                            <th>{{x.name}}</th>
                                            <th>{{x.level}}</th>
                                            <th>
                                                <span class="label label-info" ng-if="x.status==='1'"
                                                      style="font-size: 12px">启用</span>
                                                <span class="label label-danger" ng-if="x.status==='0'"
                                                      style="font-size: 12px">禁用</span>
                                            </th>
                                        </tr>
                                        <tr ng-if="!tableLoading">
                                            <th colspan="4" style="text-align: center">数据加载中......</th>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>

                            <!-- 未选择时，默认显示 -->
                            <div class="form-group clearfix" ng-if="!allocation || allocation === '-1'">
                                <div class="col-xs-12"
                                     style="border: 1px dashed #e0e0e0;text-align: center;padding: 30px">
                                    暂无数据
                                </div>
                            </div>

                            <!-- 允许流程发起人完成任务 -->
                            <div class="form-group clearfix">
                                <div class="col-xs-12">
                                    <div class="col-xs-12">
                                        <label>
                                            <input type="checkbox" ng-model="assignment.initiatorCanCompleteTask">
                                            &nbsp;{{'PROPERTY.ASSIGNMENT.INITIATOR-CAN-COMPLETE' | translate}}
                                        </label>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button ng-click="close()" class="btn btn-primary" translate>ACTION.CANCEL</button>
                <button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button>
            </div>
        </div>
    </div>
</div>
